package com.zws.cucumber.var;

public enum ZwsVarScope {

    GLOBAL {
        @Override
        public void checkBeforePutting(ZwsVarBlock block, String key, Object val) {
            if (block.containsKeyShallowly(key)) {
                throw new IllegalArgumentException("global block can not be redefined: " + key);
            }
        }
    },
    SCENARIO,
    PROCEDURE,
    ;

    public void checkBeforePutting(ZwsVarBlock block, String key, Object val) {}

}
